USE [OHNew]
GO

/****** Object:  Table [dbo].[D_StorageData]    Script Date: 12/04/2012 10:15:43 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[D_StorageData](
	[ID] [uniqueidentifier] NOT NULL,
	[StorageLocation] [uniqueidentifier] NOT NULL,
	[StorageType] [int] NOT NULL,
	[DocumentDate] [datetime] NOT NULL,
	[DocumentType] [int] NOT NULL,
	[Document] [uniqueidentifier] NOT NULL,
	[Material] [uniqueidentifier] NOT NULL,
	[Batch] [uniqueidentifier] NULL,
	[Package] [uniqueidentifier] NULL,
	[Measure] [uniqueidentifier] NULL,
	[Quantity] [decimal](18, 4) NOT NULL,
	[Price] [decimal](18, 2) NOT NULL,
	[Amount] [decimal](18, 2) NOT NULL
 CONSTRAINT [PK_D_StorageData] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]

) ON [PRIMARY]

GO

ALTER TABLE [dbo].[D_StorageData] ADD  CONSTRAINT [DF_D_StorageData_ID]  DEFAULT (newid()) FOR [ID]
GO

ALTER TABLE [dbo].[D_StorageData] ADD  DEFAULT ((0)) FOR [Quantity]
GO

ALTER TABLE [dbo].[D_StorageData] ADD  DEFAULT ((0)) FOR [Amount]
GO

ALTER TABLE [dbo].[D_StorageData] ADD  DEFAULT ((0)) FOR [Price]
GO


